#!/bin/bash
docker service rm product payment wechatpay shop gateway region alipay sfexpress jtexpress ztoexpress
docker service create --name gateway --with-registry-auth --network my-net --constraint node.labels.use==test --publish published=8080,target=8080 --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/gateway:1.0-${oomall_tag}
docker service create --name product --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs  --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/product:1.0-${oomall_tag}
docker service create --name payment --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/payment:1.0-${oomall_tag}
docker service create --name shop --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/shop:1.0-${oomall_tag}
docker service create --name region --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/region:1.0-${oomall_tag}
docker service create --name alipay --with-registry-auth  --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/alipay:1.0-${oomall_tag}
docker service create --name wechatpay --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/wechatpay:1.0-${oomall_tag}
docker service create --name freight --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/freight:1.0-${oomall_tag}
docker service create --name sfexpress --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/sfexpress:1.0-${oomall_tag}
docker service create --name jtexpress --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/jtexpress:1.0-${oomall_tag}
docker service create --name ztoexpress --with-registry-auth --network my-net --constraint node.labels.use==test --mount type=bind,source=/root/logs,destination=/app/logs --with-registry-auth -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/ztoexpress:1.0-${oomall_tag}

docker service create --name nginx --with-registry-auth --network my-net --constraint node.labels.server==nginx --mount type=bind,source=/root/oomall-2023/conf/nginx/conf.d,destination=/etc/nginx/conf.d --mount type=bind,source=/root/oomall-2023/conf/nginx/pass,destination=/etc/nginx/pass --mount type=bind,source=/root/public-test,destination=/public-test  --mount type=bind,source=/root/AutoTest/nginx/www/html,destination=/var/www/html --mount type=bind,source=/root/nginx/log,destination=/var/log/nginx --mount type=bind,source=/root/test,destination=/test --publish published=80,target=80 -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/nginx:latest
docker service create --name test --with-registry-auth --constraint node.labels.server==testserver  --mount type=bind,source=/root/oomall-2023,destination=/OOMALL --mount type=bind,source=/root/public-test,destination=/public-test --mount type=bind,source=/root/maven,destination=/root/.m2 --network my-net -d swr.cn-north-4.myhuaweicloud.com/oomall-javaee/test:v1.0  tail -f /dev/null